package midend.IR_Value;

import midend.IR_Type.IR_Array;
import midend.IR_Type.IR_Const;
import midend.IR_Type.IR_Type;

import java.util.ArrayList;
import java.util.List;

public class IR_Array_Value extends IR_Value{
    private String Array_Identity;
    private IR_Type Array_Type;
    private List<Integer> Int_Array;
    private List<Float> Float_Array;
    private boolean is_AllZero;
    private IR_Array  nowtype;

    public boolean get_is_AllZero() {
        return is_AllZero;
    }

    public void setNowtype(IR_Array nowtype) {
        this.nowtype = nowtype;
    }

    public void setIs_AllZero(boolean is_AllZero) {
        this.is_AllZero = is_AllZero;
    }

    public IR_Array_Value(String array_Identity, IR_Type array_Type) {
        Array_Identity = array_Identity;
        Array_Type = array_Type;
        this.Int_Array = new ArrayList<>();
        this.Float_Array = new ArrayList<>();
    }

    public void set_Int_Array(List<Integer> int_Array) {
        Int_Array = int_Array;
    }

    public void set_Float_Array(List<Float> float_Array) {
        Float_Array = float_Array;
    }

    public List<Integer> get_Int_Array() {
        return Int_Array;
    }

    public List<Float> get_Float_Array() {
        return Float_Array;
    }

    @Override
    public String get_ValueName() {
        return Array_Identity;
    }

    @Override
    public IR_Type get_Type() {
        return Array_Type;
    }
    @Override
    public int get_Const_Type() {
        return IR_Const.IR_ConstArray;
    }

    public int getSize(){
        return nowtype.getSize();
    }

    @Override
    public String toString() {
        return "Array Identity: " + Array_Identity + "    Array_Type: " + Array_Type;
    }
}
